package com.xkdx.guangguang.fragment.brand.branch;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.xkdx.guangguang.module.network.AbsAction;
import com.xkdx.guangguang.module.statics.IConstants;

public class BranchAction extends AbsAction {
	String shopID;

	public BranchAction(String shopID) {
		this.url = IConstants.addressV2;
		this.shopID = shopID;
		
	}

	@Override
	public void constructRequest() {
		// 商场详情
		HashMap<String, String> map = new HashMap<String, String>();
		map.put("DeviceID", "2");
		map.put("ShopID", shopID);
		String shopDetailJson = constructJson(map);
		Parameter parameter = new Parameter("shopInterface", "getShopDetail", shopDetailJson);
		
		// 优惠信息
		HashMap<String, String> newInfomap = new HashMap<String, String>();
		newInfomap.put("DeviceID", "2");
		newInfomap.put("ShopID", shopID);
		newInfomap.put("InfoType", "1|2");
		newInfomap.put("PageIndex", "1");
		newInfomap.put("PageSize", "10");
		newInfomap.put("RefreshTime", IConstants.getCommentTime());
		String newInfoJson = constructJson(newInfomap);
		Parameter newInfoparameter = new Parameter("informationInterface", "getInfoListByShop", newInfoJson);
		
//		// 单品特卖
//		HashMap<String, String> unitInfomap = new HashMap<String, String>();
//		unitInfomap.put("ShopID", shopID);
//		unitInfomap.put("Order", "");
//		unitInfomap.put("By", "");
//		unitInfomap.put("Keywords", "");
//		unitInfomap.put("Type", "");
//		unitInfomap.put("PageIndex", "1");
//		unitInfomap.put("PageSize", "10");
//
//		String unitInfoJson = constructJson(unitInfomap);
//		Parameter unitInfoparameter = new Parameter("PosDeviceChapterAction", "getProductList", unitInfoJson);
//		
		
		// 评论
		HashMap<String, String> commentmap = new HashMap<String, String>();
		commentmap.put("DeviceID", "2");
		commentmap.put("ShopID", shopID);
		commentmap.put("PageIndex", "1");
		commentmap.put("PageSize", "10");
		commentmap.put("RefreshTime", IConstants.getCommentTime());
		String commentJson = constructJson(commentmap);
		Parameter commentParameter = new Parameter("commentInterface", "getCommentListByShop", commentJson);

		List<Parameter> list = new ArrayList<AbsAction.Parameter>();
		list.add(parameter);
		//list.add(unitInfoparameter);
		list.add(newInfoparameter);
		list.add(commentParameter);
		requestData = constructMod(list);

	}

}
